<!doctype html>
<html class="no-js">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>{$site_title}</title>
  <meta name="description" content="">
  <meta name="keywords" content="">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  <meta name="renderer" content="webkit">
  <meta http-equiv="Cache-Control" content="no-siteapp" />
  <link rel="stylesheet" type="text/css" href="http://apps.bdimg.com/libs/blendui/2.0.0/boost.min.css" />
  <link rel="stylesheet" type="text/css" href="__PUBLIC__/template/default/css/webapp.css" />
  <script type="text/javascript" src="__PUBLIC__/template/default/js/jquery.min.js"></script>
  <script type="text/javascript" src="http://apps.bdimg.com/libs/blendui/2.0.0/boost.min.js"></script>
  <script type="text/javascript">window.boost = $.noConflict(true);</script>
  <style>
      .blend-panel{background-color: #fff;}
      /*.blend-suggest-wrap,.blend-suggest-wrap2{background-color: #03ab9e;}*/
      .blend-suggest-input-blue .blend-suggest-ico{
          background-color: #03ab9e;
      }
      .blend-suggest-arrow:before{
          color: #fff;
      }
      .blend-header{ background-color: #03ab9e;}
      .main-content{ background-color: #fff;}
      .blend-suggest-input-gray{height: 40px;}
      .blend-suggest-input-gray input{height: 30px; font-size: 1.8rem;}
      .main-content img{width: 100%;}
      .blend-button-large{ background-color: #03ab9e;}
      a:active,a:hover,a:visited,a:focus,a{text-decoration: none; color:#333;}
/*新增样式*/
.clear { height: 0; font-size: 0; line-height: 0; overflow: hidden; clear: both; }
.clearfix:before, .clearfix:after { display: table; line-height: 0; content: ""; }
.clearfix:after { clear: both; }
.clearfix { *zoom: 1;}
.text-wrap { word-break: break-all !important; word-wrap: break-word !important; -webkit-box-orient: inherit!important; text-overflow: inherit!important; -webkit-line-clamp: inherit!important; overflow: visible!important; display: block!important; }
#list_more .blend-card:last-child { border-bottom: none!important; }
#list_more .blend-card-img-view img { -moz-border-radius: 50%!important; -webkit-border-radius: 50%!important; border-radius: 50%!important; }
#list_more .blend-card-content-view { max-height: inherit!important; }
.well { min-height: 20px; padding: 10px; margin-top: 15px; margin-bottom: 20px; background-color: #f5f5f5; border: 1px solid #e3e3e3; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05); box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05); font-size: 14px; padding: 10px 15px; line-height: 25px; }
</style>
</head>
<body>
    <header data-blend-widget="header" class="blend-header header_title_bg">
        <span class="blend-header-left">
            <a class="blend-header-item  blend-button" href="javascript:history.go(-1);"><img src="__PUBLIC__/template/default/img/btn_back.png" style="height:28px;"/></a>
        </span>
        <span class="blend-header-title">
            <a class="blend-header-item">食事周刊</a>
        </span>
        <span class="blend-header-right">
            <if condition="$iscollection eq 0">
                <img id="collection_mark"  onclick="javascript:collection_action(1);" src="__PUBLIC__/template/default/img/collection_no.png" />
                <else/>
                <img id="collection_mark"  onclick="javascript:collection_action(0);" src="__PUBLIC__/template/default/img/collection_yes.png" />
            </if>
<!--             <img id="collection_mark" ifcollection="{$get_new.ifcollection}" onclick="javascript:collection_action({$get_new.ifcollection});" src="__PUBLIC__/template/default/img/choose_friend.png" /> -->
        </span>
    </header>
    
    <div class="main-content">
        <div class="blend-panel" style=" padding:5%;">
            <div class="blend-panel-left">
                <span><b style="font-size:1.6rem;">{$list.title}</b></span><br />
                <span style="font-size:1.3rem;">{$list.author} {$list.stime|date="Y-m-d",###}</span>
                <div class="blend-separator"></div>
            </div>
            <div class="blend-panel-left" style="font-size:1.6rem;">
                {$list.content}
            </div>
            <div>
              
            </div>
        </div>
    </div>
    
    <div class="blend-panel">
        <div class="blend-panel-header blend-panel-left">
            精彩评论 <span style="float:right; color: #03ab9e;" id='add_commnet'> + 我来说两句</span>
        </div>
        <div class="blend-panel-body" style=''>
           <notempty name="hot_comments">
                <div id='list_more'>
                <volist name="hot_comments" id="vo">
                        
                    
                    <div class="blend-card blend-card-no-icon clearfix" style="position: relative;">              
                                        <div class="blend-card-img-view" style="float: left;"> <img src="{$vo.avatar}" style="border-radius:100%;"></div>
                                        <div class="blend-card-content-view" style="width:75%;float: right; min-height: 70px; max-height:inherit;">
                                                <div class="blend-card-title clearfix"> <span>{$vo.username}</span>
                                                        <div style=" float:right; margin-left:5%;"> <a href="{:U('M/Information/child_comments',array('id' => $vo['id']))}"><img src="__PUBLIC__/template/default/img/comments_child.png" style="width:1.6rem; height:1.6rem; ">&nbsp; <span class="small_tips">{$vo.comment_count}</span> </a> </div>
                        <div  style=" float:right;"><img class='likeit' cid='{$vo.id}' src="__PUBLIC__/template/default/img/comment_likes.png" style="width:1.6rem; height:1.6rem; ">&nbsp; <span class="small_tips likecount">{$vo.likecount}</span> </div>
                                                        <div style="clear:both"></div>
                                                </div>
                                                <div class="blend-card-sub-title"><span>{$vo.ctime|date="Y-m-d H:i",###}</span></div>
                                                <a href="{:U('M/Information/child_comments',array('id' => $vo['id']))}">
                                                        <div class="blend-card-text comment-content text-wrap" style="margin-top:10px;margin-bottom:10px;height:auto"><span style="font-size:14px;">{$vo.content}</span></div>
                                                </a>
                                                <if condition="$vo.child_comment_count gt 0">
                            <div class="well">
                              <ul style="margin: 0;padding: 0;list-style: none">
                                <volist name="vo.child_comments" id="voo">
                                  <li><span style="color: #03ab9e;">{$voo.username}：</span>{$voo.content}</li>
                                </volist>

                              </ul>
                              <a  href="{:U('M/News/comment_detail',array('fdid'=>$vo['for_id'],'pid'=>$vo['id']))}" style="color: #03ab9e;">查看更多评论</a>
                          </div>
                        </if>
                            </div>
                            <div style="clear:both"></div>
                    </div> 

                </volist>
                </div>

            <else/>
                暂无评论,我来说两句.
            </notempty> 
            
            
        </div>
        <div class="blend-panel-footer blend-panel-center" style="font-size:1.5rem; color: #03ab9e;">
            <a href="{:U('M/Information/weekly_comments',array('id' => $list['id']))}" style="font-size:1.5rem; color: #03ab9e;"> 查看更多评论({$all_comments_count}) &gt; </a>
        </div>
    </div>
    
    <div id="customDialog" class="blend-dialog">
        <div class="blend-grid blend-container-fluid" style="margin-top:20px;">
            <div class="blend-formgroup">
                <textarea class="blend-formgroup-input" style=" height: 60px;" id="content" name="content" placeholder="我想说两句..."></textarea>
            </div>
            <div class="" style=" margin-top:10px; margin-bottom:10px;">
                <button class="blend-button blend-button-primary blend-button-large" id="success" style=" background-color:#03ab9e;">发布</button>
            </div>  
        </div>
    </div>
    <!--<a class="blend-button blend-button-primary blend-button-large" href="{:U('M/News/comments',array('fdid'=>$get_new['id'],'pid'=>0))}">评论入口</a>-->
<!--底部菜单end-->
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script>
boost("#customDialog").dialog({
    maskTapClose:true,
    renderType:2
});
$(document).ready(function(){

    $("#add_commnet").bind('click',function(){
        boost(".blend-dialog").dialog("show");
    });


    $("#success").bind('click',function(){

        var content = $("#content").val();
        var for_id = {$list.id};
        var ctype = 6;
        var url = "{:U('M/Information/add_commnet')}";
        var now_url = window.location.href;
        $.ajax({
            type:'post',
            url:url,
            data:{content:content,for_id:for_id,ctype:ctype},
            dataType:'json',
            success:function(data){

                if(data==1){

                    window.location.href = now_url;
                }else if(data==2){

                    alert('存在敏感词!');
                }
            }
        });
    });



    /**
     * 点赞功能
     */
    
    $(".likeit").one('click',function(){
        
        var mid = $(this).attr("mid");
        var cid= $(this).attr("cid") ;
        
        var likecount = parseInt($(this).parent().find(".likecount").text());
        
        $(this).attr("src","__PUBLIC__/template/default/img/evaluation_zan_sel.png");
        
        likecount++;
        $(this).parent().find(".likecount").text(likecount);
        $.ajax({ 

         type: 'GET', 
         url: '{:U("M/Founding/comments_like_add")}', 
         dataType: 'json', 
         data:"cid="+cid+"&mid="+mid,
         cache: false, 
         error: function(){ 
             return false; 
         }, 
         success:function(json){ 
              if(json===1)
              {
                  //本地刷新
                  
              }
              else
              {
                  alert("添加失败，请稍后再试");
                  
              }
              
              
         } 
        });
    });

});

function collection_action(iscollection){
     
     var iscollection = iscollection;
     var for_id = {$list.id};
     var ctype = 6;   
     var now_url = window.location.href;
    $.ajax({ 
        type: 'post', 
        url: '{:U("M/Information/add_one_colletion")}', 
        dataType: 'json', 
        data:{iscollection:iscollection,for_id:for_id,ctype:ctype},
        cache: false, 
        error: function(){ 
            return false; 
        }, 
        success:function(data){ 

           //修改成功
           if(data==1 && iscollection==0)
           {
               var toast = boost.blend.toast();
               toast.show("取消收藏",1000);
               window.location.href = now_url;
           }
           else
           {
               var toast = boost.blend.toast();
               toast.show("收藏成功",1000);
               window.location.href = now_url;
           }
                 
        } 
    });
    }

</script>

<?php require_once 'cs.php';echo '<img src="'._cnzzTrackPageView(1256622573).'" width="0" height="0"/>';?>
<include file="Index/foot_analyze"/>
</body>
</html>